import React from 'react'
import { Navigate } from 'react-router-dom'
const MainLayout = React.lazy(() => import('../mainLayout'))
const Home = React.lazy(() => import('../views/home'))
const Set = React.lazy(() => import('../views/set'))
const Upload = React.lazy(() => import('../views/upload'))
const Signin = React.lazy(() => import('../views/signin'))
const OSSUpload = React.lazy(() => import('../views/ossUpload'))

const routes = [{
	path: '/home',
	element: <MainLayout>
		<Home></Home>
	</MainLayout>,
	meta: {
		title: '首页'
	}
}, {
	path: '/upload',
	element: <MainLayout>
		<Upload></Upload>
	</MainLayout>,
	meta: {
		title: '上传文件'
	}
}, {
	path: '/oss/upload',
	element: <MainLayout>
		<OSSUpload></OSSUpload>
	</MainLayout>,
	meta: {
		title: '云上传'
	}
}, {
	path: '/set',
	element: <MainLayout>
		<Set></Set>
	</MainLayout>,
	meta: {
		title: '用户设置'
	}
}, {
	path: '/signin',
	element: <Signin></Signin>,
	meta: {
		title: '用户登录',
		// 是否显示导航菜单
		hidden: true
	}
}, {
	path: '/',
	element: <Navigate to="/home"></Navigate>,
	meta: {
		title: '重定向',
		// 是否显示导航菜单
		hidden: true
	}
}]

export default routes